package cn.lingyangwl.agile.member.service;

import cn.lingyangwl.agile.member.MemberApi;
import cn.lingyangwl.agile.member.assembly.MemberUserAssembly;
import cn.lingyangwl.agile.member.model.rqrs.user.MemberUserRegisterReq;
import cn.lingyangwl.agile.member.model.rqrs.user.MemberUserResp;
import cn.lingyangwl.agile.member.model.rqrs.user.MemberUserUpdateReq;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author shenguangyang
 */
@Service
public class MemberApiImpl implements MemberApi {
    @Resource
    private MemberUserAssembly userAssembly;
    @Resource
    private MemberUserService memberUserService;

    @Override
    public MemberUserResp registerUserIfAbsent(MemberUserRegisterReq req) {
        return userAssembly.toUserResp(memberUserService.registerUserIfAbsent(req));
    }

    @Override
    public void updateUser(MemberUserUpdateReq req) {
        memberUserService.updateUser(req);
    }
}
